<!--
 * @Description: 
 * @Author: mxy
 * @Date: 2022-11-08 20:44:38
 * @LastEditors: mxy
 * @LastEditTime: 2022-11-08 21:08:58
-->
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <button>点击添加一本书</button>

    <script src="./axios.js"></script>
    <script>
        document.querySelector('button').addEventListener('click', function () {
            axios({
                method: 'POST',
                url: 'http://www.itcbc.com:3006/api/addbook',
                data: {
                    bookname: '追风筝的人',
                    author: '胡赛尼',
                    publisher: '外国',
                    appkey: 'xiaomeng'
                }
            }).then(({ data }) => {
                console.log(data)
            })
        })

    </script>
</body>

</html>